Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

book: Add chapter about subclassing GtkWidget and drawing #975

Open
JMS55 opened this issue Mar 18, 2022 · 0 comments
Open

book: Add chapter about subclassing GtkWidget and drawing #975

JMS55 opened this issue Mar 18, 2022 · 0 comments
Labels

Comments

@JMS55
Copy link

JMS55 commented Mar 18, 2022

  • How to use measure(), and how it will get called twice. It wasn't initially apparent that you weren't supposed to give the size of both axis at once, and instead were only supposed to give one based on the orientation argument. Also that you can pass -1 for things like baseline measurements.
  • Using measue() vs css properties like max-width
  • In general, provide some quick guidelines on how to use measure/vexpand/hexpand for common usecases like: fixed width and height, variable width with a minimum and fixed height, fully fluid and adapting to the widget size, height-for-width, etc.
  • Layout managers and when to use them - for instance, you can use BoxLayout instead of having a child box

  • Some basic snapshot() examples showing rectangles, text, gradients, etc.
  • Go over the coordinate system, and how there's nothing preventing you from drawing further than the widget's bounds - you should get the widget's size, and not draw past that. You can also set overflow to hidden.
  • Setting a css name for the widget, and using that for things like borders or padding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants