How do I create a multiform GTK App [closed] - c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hi I have been playing around with C and Gtk trying to learn a thing or two
Now wondering how do I create an application that has more then one form.
Do I just clear the window out or do I create new windows every time I want to have another form or view.
and does anyone know a good place to learn this type of thing?

I assume your goal is to use one window but change (large parts of) the window contents at times?
The widget you are looking for is GtkStack, which is a container that will only show one of its children at a time. You can use a Stack with user visible controls (StackSwitcher) or from your own code.
The Stack was only added in 3.10, so in earlier GTK+ versions you'll need to do the work yourself: Add your "forms" as children of a Box and make sure only one child is shown at a time.
does anyone know a good place to learn this type of thing?
To find out what kind of widgets you have at your disposal, I suggest reading the fine manual: https://developer.gnome.org/gtk3/stable/.

Related

What should be considered as component in React [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am new to React and was learning what component is and what should be considered as component. As I found out component is considered as a certain block of a web page that can be reused and I hope I am right with this statement. But as you can see in the picture below button "What should I do" and add caption with input box together are considered as components. Why? those buttons are not reused anywhere in the same page so why should they be components. As far as I know, Component is a block that is reused in the same page several times
Flexibility.
If you particularly style your button one way and it takes a lot of copy-paste to use it elsewhere, why not make it a component and just call it.
Alternatively if it's fairly simple, you can just write it as is and move on instead of going through the overhead of making it a component.
It's entirely up to you.
Don't take the re-usability aspect too serious. Think of components as parts of a machine. You can order a motherboard, screen, mouse, keyboard... for a computer, or you can order the laptop as a whole. Up to you.
This really depends on you. The idea is to make as much reusable components as possible in React, if you stick to this formula your life will not only be easier but also your project will look clean and proper.

How to populate list from api and pass data to new page when item is clicked?(react native) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am very new to react native and am trying to populate a list with an image and a heading using a fetch() call from a web service . I need this list to populate as soon as the page is displayed. I am struggling to find the right method/event to put my logic in .
Also i have a separate page to see the detailed article. Is there a clean way to pass on information to this page so i can avoid making another api call or a messy global variable.
You should read up on Redux. It might seem a bit hard to understand while reading but the implementation is pretty simple and straight forward.
Also, take a look at this article by Dan Abramov, the main contributor of Redux, talking about Presentational and Container components.

C - Non-obtrusive graphics library? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've used GUI's in other languages but never a low language like C. I've looked online and found that SDL is the ideal choice but unfortunately I don't like the fact that it runs within a window of it's own. Is there any way to just draw directly to the screen without any other features?
For example, if I wanted to draw a shape that stays ontop of other windows, but is not just a stage that has its property set to transparent.
If that's not possible, then I'm looking for something as simple and as hassle free as possible. My goal is to create something like this
Is there any way to just draw directly to the screen without any other features?
This depends on what environment you run in, but in general: No, if you're running on a system with some kind of display management (you are, unless you forgot to mention you're doing bare-bone graphics on some microcontroller.) someone has to assign you a kind of window to do drawing.
For example, if I wanted to draw a shape that stays ontop of other windows, but is not just a stage that has its property set to transparent.
As said, you'll need someone to give you a buffer to draw on. And that's exactly what a window is.
If that's not possible, then I'm looking for something as simple and as hassle free as possible. My goal is to create something like this
SDL & OpenGL, or really: Use some game/3D engine.

Build an interface using only the SDL and the C standard library [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need to make a program using only the C standard library and the SDL. I can't use the Windows API or any other library. I need to use only the C language i.e. no C++, no C# etc.
I have really no idea on how to achieve that since I only know to output to the standard output device (console) and files. So I hope you can give me an example on how to open a window with two buttons (custom built): one to exit and one to perform any task.
To create a window: https://wiki.libsdl.org/SDL_CreateWindow?highlight=%28%5CbCategoryVideo%5Cb%29%7C%28CategoryEnum%29%7C%28CategoryStruct%29
About the buttons, you gotta compare the mouse coords and if the user is clicking on the desired spot to do whatever you want. To get this user input data you gotta use the sdl event handling system. You can learn about it trought sdl's wiki or you check this tutorial http://lazyfoo.net/SDL_tutorials/lesson04/index.php (i'm sure that there are other tutorials out there if you google it).
To draw the buttons to the sccreen you have to use SDL's rendering system.
Your question is not that specific, so that is the best i can do for you.

Tab structure best practices [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
When developing a WinForms app that will utilize a tab control to display different sets of data, is it best to add all my controls to the tabs directly, OR create user controls, add my controls to the UC and add the UC to each of the different tabs?
I was informed that the UC approach is best practice, and I understand some of the benefits, but I'm wondering if this is truly the way to go... any explanation either way is greatly appreciated!
I have found that personally I do like the UserControl model, it helps get the code separate by each of the functions (tabs), and helps with UI design time.
You can do it either way, but I have had much better long-term success going the route of UserControl.
In addition to the code separation, I think that adding the UC to a tab control ultimately makes it a lot more flexible. For example, if the UI changes over time and tabs are no longer necessary, it can easily be popped out and placed somewhere else. Or if the UC can be reused in a different context, it won't require a tab control to travel with it.

Resources